<?php
include('db.php');
$db = getDb();

$content=file_get_contents("../view/subevents.html");
$_SUBEVENTS_="_SUBEVENTS_";
$_SUBEVENTS_content="";

$_ID_="_ID_";
$_ID_content= $_GET["id"];



$sqlCommand="SELECT id,subject FROM subevent WHERE eventid=". $_GET["id"];
$result = $db->Execute($sqlCommand);

if ($result === false)
	die($sqlCommand);

while (!$result->EOF)
{
	$_SUBEVENTS_content.= "<li><a href=\"details.php?id=". $result->fields[0] . "\">". $result->fields[1] ."</a> </li>\n";

	$result->MoveNext();
}

 
 // Display page
 $content = str_replace($_SUBEVENTS_ , $_SUBEVENTS_content, $content);
 $content = str_replace($_ID_ , $_ID_content, $content);
 echo $content;
?>



<!-- <option value="a">a</option>  -->